package demo.practice.bit;

public class MS1601 {

    public static void main(String[] args) {
        int a=5,b=10;
        a=a^b;
        b=a^b;
        a=a^b;
        System.out.println(a);
        System.out.println(b);
    }

    public int[] swapNumbers(int[] numbers) {

        /*int a=5,b=10;
        a=a^b;
        b=a^b;
        a=a^b;*/



        if (numbers == null || numbers.length!=2)
            return numbers;

        numbers[0]= numbers[0]^numbers[1];
        numbers[1]= numbers[0]^numbers[1];
        numbers[0]=  numbers[0]^numbers[1];


        return numbers;
    }



}
